package com.wangtongxiao.beans;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class MyApp {
    public static void main(String[] args) throws IOException {
        String temp="aaaaaa";
        String path="d:\\abc.txt";

        FileOutputStream fileOutputStream= null;
        try {
            fileOutputStream = new FileOutputStream(path,false);
            byte[] bytes= temp.getBytes();
            fileOutputStream.write(bytes,0,bytes.length);
            fileOutputStream.flush();//吧缓存的数据写入到文件
            fileOutputStream.close();
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        }


    }
}
